﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using STLGROUP.Layers.Presentations.FormBase;
using STLGROUP.Layers.Common;

namespace QuanLyBanHang
{
    /// <summary>
    /// Danh muc loai san pham
    /// </summary>
    /// <author>viet sang</author>
    /// <date>19/04/2012</date>
    public partial class CF003 : frmCatalogBase
    {
        public CF003()
        {
            InitializeComponent();
            InitializeForm();
        }

        private void InitializeForm()
        {
            UICommon.AddTrackingColumn(dgvLoaiSanPham);
        }

        protected override void LoadData()
        {
            this._bindingSource.DataSource = Cache.Context.DM_LoaiSanPham;
            dgvLoaiSanPham.DataSource = _bindingSource;

            base.LoadData();
        }

        protected override void AddDataBinding()
        {
            txtIDLoaiSanPham.DataBindings.Add(Const.BIND_TEXT, _bindingSource, "IDLoaiSanPham", true);
            txtTenLoaiSanPham.DataBindings.Add(Const.BIND_TEXT, _bindingSource, "TenLoaiSanPham", true);
        }

        protected override void AddNew()
        {
            base.AddNew();
            txtTenLoaiSanPham.Focus();
        }

    }
}
